package com.xuecheng.media.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliyunConfig {

    @Autowired
    private AliyunProperties aliyun;
    @Bean
    public DefaultAcsClient client() {
        DefaultProfile profile = DefaultProfile.getProfile(
                aliyun.getRegion(),
                aliyun.getAccessKeyId(),
                aliyun.getAccessKeySecret());
        return new DefaultAcsClient(profile);
    }
}
